<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
<head>
	<title>论坛主页</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>

<body>
	<h1>帖列表</h1>
	<s:form action="maintie_list.do" method="post">
		<table border="1">
			<tr>
				<td colspan="6">
					<a href="${pageContext.request.contextPath}/maintie_add.do">添加帖</a>
				</td>
			</tr>
			<tr>
				<td>帖编号</td>
				<td>帖标题</td>
				<td>帖内容</td>
				<td>发帖时间</td>
				<td>发帖人</td>
				<td>操作</td>
			</tr>
			<s:iterator value="page.resultlist" status="y">
                <s:if test="#y.odd==true">
                    <tr bgcolor="#ccffff">
				</s:if>
                <s:else>
                	<tr bgcolor="#99ffcc">
               	</s:else>
                		<td><s:property value="mid"></s:property></td>
	                    <td><s:property value="mtitle"></s:property></td>
	                    <td><s:property value="mcontent"></s:property></td>
	                    <td><s:date name="mdate" format="yyyy-MM-dd HH:mm:ss" /></td>
	                    <td><s:property value="TUser.userName"></s:property></td>
	                    <td>
		                    <a href="${pageContext.request.contextPath}/maintie_update.do?mainTie.mid=<s:property value="mid"/>">修改</a>&nbsp;
		                    <a href="${pageContext.request.contextPath}/maintie_delete.do?mainTie.mid=<s:property value="mid"/>">删除</a>&nbsp;
		                    <a href="${pageContext.request.contextPath}/maintie_view.do?mainTie.mid=<s:property value="mid"/>">查看</a>
	                    </td>
                	</tr>
            </s:iterator>
		</table>
		<s:if test="page.currentPage==1">
			  首页&nbsp;上一页
		</s:if>
		<s:else>
			<a href="maintie_list.do?page.page=1" class="page_word">首页</a>
			<a href="maintie_list.do?page.currentPage=<s:property value='page.currentPage-1'/>">上一页</a>
		</s:else>
	    <s:iterator value="page.pageNum" var="x">
		    <s:if test="page.currentPage==#x">
		        <s:property/>
	        </s:if>
	        <s:else>
	        	<a href="maintie_list.do?page.currentPage=<s:property/>"><s:property/></a>
	        </s:else>
	    </s:iterator>
	    <s:if test="page.currentPage==page.maxPage">
                            下一页&nbsp;尾页&nbsp;
        </s:if>
        <s:else>
	    	<a href="maintie_list.do?page.currentPage=<s:property value='page.currentPage+1'/>">下一页</a>
	    	<a href="maintie_list.do?page.currentPage=<s:property value="page.maxPage"/>" class="page_word">尾页</a>&nbsp;
	    </s:else>
	   	第<s:property value='page.currentPage'/>页
	    &nbsp;共<s:property value='page.total'/>条记录
	</s:form>
</body>
</html>
